package com.genexususa.eo.bing.test.delete;

import com.genexususa.eo.bing.connection.TargetManager;
import com.genexususa.eo.bing.test.TestUtil;

public class ConsumeDeleteTargetAssociations {
    public static void main(String[] args) {
        TestUtil testUtil = new TestUtil();
        String targetAssociationsRequestsXML =  "<Bing_TargetCampaignsRequestCollection>\n" +
                                                    "\t<Bing_TargetCampaignsRequest>\n" +
                                                        "\t\t<AssociateCampaign>true</AssociateCampaign>\n" +
                                                        "\t\t<GxCampaignId>5445648942</GxCampaignId>\n" +
                                                        "\t\t<BingCampaignId>" + testUtil.campaignId1 + "</BingCampaignId>\n" +
                                                        "\t\t<AdGroupCollection>\n" +
                                                            "\t\t\t<AdGroup>\n" +
                                                                "\t\t\t\t<AdDistribution xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<BiddingModel xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<GxAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">64554964</GxAdGroupId>\n" +
                                                                "\t\t\t\t<BingAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">" + testUtil.adGroup11 + "</BingAdGroupId>\n" +
                                                                "\t\t\t\t<Language xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<Name xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<Network xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<PricingModel xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<Status xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                            "\t\t\t</AdGroup>\n" +
                                                            "\t\t\t<AdGroup>\n" +
                                                                "\t\t\t\t<AdDistribution xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<BiddingModel xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<GxAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">64554965</GxAdGroupId>\n" +
                                                                "\t\t\t\t<BingAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">" + testUtil.adGroup12 + "</BingAdGroupId>\n" +
                                                                "\t\t\t\t<Language xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<Name xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<Network xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<PricingModel xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<Status xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                            "\t\t\t</AdGroup>\n" +
                                                        "\t\t</AdGroupCollection>\n" +
                                                    "\t</Bing_TargetCampaignsRequest>\n" +
                                                    "\t<Bing_TargetCampaignsRequest>\n" +
                                                        "\t\t<AssociateCampaign>true</AssociateCampaign>\n" +
                                                        "\t\t<GxCampaignId>5445648943</GxCampaignId>\n" +
                                                        "\t\t<BingCampaignId>" + testUtil.campaignIdAux1 + "</BingCampaignId>\n" +
                                                        "\t\t<AdGroupCollection>\n" +
                                                        "\t\t</AdGroupCollection>\n" +
                                                    "\t</Bing_TargetCampaignsRequest>\n" +
                                                    "\t<Bing_TargetCampaignsRequest>\n" +
                                                        "\t\t<AssociateCampaign>false</AssociateCampaign>\n" +
                                                        "\t\t<GxCampaignId>5445648944</GxCampaignId>\n" +
                                                        "\t\t<BingCampaignId>" + testUtil.campaignId2 + "</BingCampaignId>\n" +
                                                        "\t\t<AdGroupCollection>\n" +
                                                            "\t\t\t<AdGroup>\n" +
                                                                "\t\t\t\t<AdDistribution xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<BiddingModel xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<GxAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">64554966</GxAdGroupId>\n" +
                                                                "\t\t\t\t<BingAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">" + testUtil.adGroup21 + "</BingAdGroupId>\n" +
                                                                "\t\t\t\t<Language xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<Name xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<Network xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<PricingModel xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<Status xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                            "\t\t\t</AdGroup>\n" +
                                                            "\t\t\t<AdGroup>\n" +
                                                                "\t\t\t\t<AdDistribution xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<BiddingModel xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<GxAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">64554967</GxAdGroupId>\n" +
                                                                "\t\t\t\t<BingAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">" + testUtil.adGroup22 + "</BingAdGroupId>\n" +
                                                                "\t\t\t\t<Language xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<Name xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<Network xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<PricingModel xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                                "\t\t\t\t<Status xmlns=\"https://adcenter.microsoft.com/v8\"/>\n" +
                                                            "\t\t\t</AdGroup>\n" +
                                                        "\t\t</AdGroupCollection>\n" +
                                                    "\t</Bing_TargetCampaignsRequest>\n" +
                                                    "\t<Bing_TargetCampaignsRequest>\n" +
                                                        "\t\t<AssociateCampaign>true</AssociateCampaign>\n" +
                                                        "\t\t<GxCampaignId>5445648945</GxCampaignId>\n" +
                                                        "\t\t<BingCampaignId>" + testUtil.campaignIdAux2 + "</BingCampaignId>\n" +
                                                        "\t\t<AdGroupCollection>\n" +
                                                        "\t\t</AdGroupCollection>\n" +
                                                    "\t</Bing_TargetCampaignsRequest>\n" +
                                                "</Bing_TargetCampaignsRequestCollection>\n";
        TargetManager resource = new TargetManager();
        System.out.println("Consuming DeleteTargetAssociations.....");
        String userName = testUtil.userName;
        String password = testUtil.password;
        String developerToken = testUtil.developerToken;
        long customerId = testUtil.customerId;
        long customerAccountId = testUtil.customerAccountId;
        String applicationId = testUtil.applicationId;
        String result = resource.deleteTargetAssociations(customerAccountId, targetAssociationsRequestsXML);
        System.out.println("Result:\n" + result);
    }
}
